package view.macrogui
{
	import events.GuiEvent;
	import flash.display.Sprite;
	import view.macrogui.SidebarItem;
	
	/**
	 */
	public class TabSelector extends Sprite implements SidebarItem
	{
		private var buttons:Vector.<TabSelectorButton>;
		static public const HEIGHT:Number = 20;
		
		public function TabSelector()
		{
			buttons = new Vector.<TabSelectorButton>();
			
			var texts:Vector.<String> = new <String>["Units", "Buildings"];
			for (var i:int = 0; i < texts.length; i++)
			{
				var button:TabSelectorButton = new TabSelectorButton(texts[i], int((SideBar.WIDTH - 2 * SideBar.PADDING) / texts.length));
				buttons.push(button);
				button.x = int(i * (SideBar.WIDTH - 2 * SideBar.PADDING) / texts.length);
				addChild(button);
			}
			
		}
		
		public function getHeight():int
		{
			return HEIGHT;
		}
	
	}

}